const db = require('../db/index');
const DataType = require('sequelize');
/**es6继承 会员卡表*/
class TimeCard extends DataType.Model {}
TimeCard.init(
    {
        id: {
            type: DataType.INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true
        },
        price: {
            type: DataType.DECIMAL(10, 2),
            comment: '金额',
            defaultValue: 0,
            allowNull: false
        },
        actualPrice: {
            type: DataType.DECIMAL(10, 2),
            comment: '实际金额',
            defaultValue: 0,
            allowNull: false
        },
        limit: {
            type: DataType.INTEGER,
            comment: '总共多少次',
            defaultValue: 0,
            allowNull: false
        },
        effective: {
            type: DataType.INTEGER,
            comment: '有效期',
            defaultValue: 0,
            allowNull: false
        },
        desc: {
            type: DataType.STRING,
            comment: '规则描述',
            defaultValue: 0,
            allowNull: false
        },
        status: {
            type: DataType.BOOLEAN,
            comment: '0删除 1正常',
            defaultValue: 1,
            allowNull: false
        }
    },
    {
        tableName: 'timeCard',
        modelName: 'timeCard',
        sequelize: db
    }
);
// TimeCard.sync({ force: true });
exports['default'] = TimeCard;
